<template>
    <div class="box">
        <div class="header">
            <van-nav-bar title="购物车" left-arrow @click-left="$router.go(-1)" />
        </div>
        <div class="meddle">
            <ul>
                <li v-for="item in list" :key="item.id">
                    <img :src="item.image" alt="">
                    <p>{{ item.title }}</p>
                    <p style="color: red;">￥{{ item.price }}</p>
                </li>
            </ul>
        </div>
        <van-submit-bar :price="7702" button-text="提交订单" @submit="onSubmit" @click="$router.push('/dizhi')"/>
    </div>

</template>
<script setup>
import request from "@/utils/request.js";
import { ref, onMounted } from "vue";
const list = ref([])
onMounted(() => {
    request.get('/list', {
        params: {
            pagination: 1, pageNum: 1
        }
    }).then(res => {
        if (res.data.code == 200) {
            list.value = res.data.data
        }
    })
})
</script>